thin.define(function(exports) {
	// 删除项目
	exports('submitDeleteProject', function() {
		var _id = $(this).attr('data-proid'),
			iscp = $(this).attr('data-iscp'),
			iscx = $(this).attr('data-iscx');

		var str = '';
		if(iscp == 1) str += '该项目已缴纳评估费，<br/>';
		if(iscx == 1) str += '该项目已缴纳诚信保证金，<br/>';
		str += '是否删除该项目？';

		layer.open({
			type: 0,
			title: '提示 ',
			content: str,
			btn: ['确定', '取消'],
			yes: function(index) {
				layer.load(0, {
					shade: [0.08, '#000']
				});
				// 删除项目
				__getdata_prodelete['project_id'] = _id;
				factory.request('_project_delete');
				layer.close(index);
			},
			btn2: function(index) {
				layer.close(index);
			}
		});
	});
});

var __getdata_prodelete = {};

// 删除项目回调
function __complete_prodelete(res) {
	layer.closeAll('loading');
	if(res.status == 204) {
		layer.msg('项目删除成功', {
			icon: 1,
			time: 1200
		}, function() {
			//window.location.href = '/member.html#member';
			window.location.reload();
		});
	} else {
		layer.msg(res.error, {
			icon: 2,
			time: 800
		});
	}
}